package diy.listener;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.event.ApplicationContextEvent;

/**
 * 自定义事件，必须是ApplicationContextEvent的子类
 * @date 2020/5/25 15:38
 */
public class DiyBeforeBeanInitEvent extends ApplicationContextEvent implements InitializingBean {
	/**
	 * Create a new ContextStartedEvent.
	 *
	 * @param source the {@code ApplicationContext} that the event is raised for
	 *               (must not be {@code null})
	 */
	public DiyBeforeBeanInitEvent(ApplicationContext source) {
		super(source);
		System.out.println("DiyBeforeBeanInitEvent 被实例化了，因为被new 了");
	}


	@Override
	public void afterPropertiesSet() throws Exception {
		System.out.println("DiyBeforeBeanInitEvent afterPropertiesSet");
	}
}
